# 导入随机工具包
import random

player = int(input("情输入你的出法：1 石头 2 剪刀 3 布"))

# 生成的随机数是 1=<random<=3
computer = random.randint(1, 3)

# 格式化输出
print("玩家出的是 %d - 电脑出的是 %d" % (player, computer))

if (player == 1 and computer == 2) or (player == 2 and computer == 3) or (player == 3 and computer == 1):
    print("玩家获胜")
elif player == computer:
    print("平局，请重新输入")
else:
    print("电脑获胜")
